package org.dromara.xxmj.mapper;

import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.xxmj.domain.CourseExercise;
import org.dromara.xxmj.domain.vo.CourseExerciseVo;
import org.dromara.xxmj.domain.vo.CoursePracticeVO;
import org.dromara.xxmj.domain.vo.GetTodayPracticeVO;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 课程习题Mapper接口
 *
 * @author Vincent
 */
@Repository
public interface CourseExerciseMapper extends BaseMapperPlus<CourseExercise, CourseExerciseVo> {

    /**
     * 获取视频关联的习题列表
     *
     * @param videoId 视频ID
     * @return 习题列表
     */
    List<CourseExerciseVo> selectExercisesByVideoId(Long courseId,Long videoId,Long  userId);

    /**
     * 获取习题详情
     *
     * @param id 习题ID
     * @return 习题详情
     */
    CourseExerciseVo selectExerciseDetail(Long id,  Long userId);

    /**
     * 检查用户是否已完成习题
     *
     * @param userId 用户ID
     * @param exerciseId 习题ID
     * @return 是否已完成
     */
    Boolean checkUserCompletedExercise(Long userId, Long exerciseId);


    GetTodayPracticeVO getTodayPractice(Long userId);

    List<Map<String, Object>> getCreateDays(Long userId);

    List<CoursePracticeVO> getRecentPractice(Long userId);
}
